﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TPOJ.Model;
using TPOJ.IDAL;
using TPOJ.DALFactory;

namespace TPOJ.BLL
{
    public class ProblemBO
    {
        private static readonly IProblemDAO dal = DataAccess.CreateProblemDAO();

        public IList<Problem> GetAllProblems()
        {
            return dal.GetAllProblems();
        }

        public IList<Problem> GetProblemsByVolume(int volumeId)
        {
            return dal.GetProblemsByVolume(volumeId);
        }

        public Problem GetProblem(int id)
        {
            return dal.GetProblem(id);
        }

        public void Create(Problem problem)
        {
            dal.Create(problem);
        }

        public Problem Edit(Problem problem)
        {
            return dal.Edit(problem);
        }
    }
}
